﻿using System;
using System.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Security.Permissions;
using System.Web.UI.Design;
using System.Web.UI.Design.WebControls;
using Org.Eurekaa.DNJ.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Org.Eurekaa.DNJ.UI.Design.WebControls
{
    [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)]
    class DNJAccordionControlDesigner : DNJMultiboxControlDesigner
    {


        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            for (int i = 0; i < MultiboxControl.BoxList.Count; i++)
            {
                (MultiboxControl.Controls[i * 2] as HtmlGenericControl).Attributes[DesignerRegion.DesignerRegionAttributeName] = i.ToString();
                if (i == MultiboxControl.CurrentDesignBox)
                    (MultiboxControl.Controls[(i * 2) + 1] as HtmlGenericControl).Attributes[DesignerRegion.DesignerRegionAttributeName] = (MultiboxControl.BoxList.Count).ToString();
            }
        }

    }


}
